export default {
  state: {
    userResume: {
      "uId": "",
      "gander": "",
      "name": "",
      "birth": "",
      "newAddress": "",
      "politicalOutlook": "",
      "phone": "",
      "email": "",

      "jobTitle": "",
      "jobSalary": "",
      "jobIndustry": "",

      "schoolTime": "",
      "eduSchoolName": "",
      "eduMajor": "",
      "eduEducation": "",
      "eduMajorDetail": "",

      "jobExTime": "",
      "jobExEnterprise": "",
      "jobExLevel": "",
      "jobExDetail": "",

      "projectTime": "",
      "projectEnterprise": "",
      "projectName": "",
      "projectDetail": "",

      "userHonors": [],
      "userSelfEvaluation": "",
    }



  },
  getters:{
    getUserAge(state: any) {
      // 计算年龄
      const birth = state.userResume.birth
      const nowData = new Date()
      const birthArr = birth.split("-")
      const year = parseInt(birthArr[0])
      const mouth = parseInt(birthArr[1])

      let age
      if (nowData.getMonth() - mouth < 0) {
        age = nowData.getFullYear() as any - year - 1
      } else {
        age = nowData.getFullYear() as any - year
      }
      if (age < 0) age = 0
      return age
    },
  }
}